package com.easyui.bean;

import java.util.List;
import java.util.Map;

import com.easyui.common.SelAttach;
import com.easyui.common.SelNote;
import com.easyui.common.SelProject;
import com.easyui.common.UserLogin;

public class HeadNote {
	private int nno;// 帖子ID
	private int pno;
	private String ntitle;// 标题
	private String ncont;
	private String ptime;// 创建时间
	private String ltime;// 更新时间
	private String pubtype;
	private String pubno;
	private String pubname;// 发布者
	private String attach;
	private String isleaf;
	private int rootid; 
	private int pid;
	private List<Map> replyList;// 回复数
	private List<Map> attachList= null;//项目附件
	private List<Map> pubinfo = null;//项目附件
	
	/**
	 * 查看主题帖列表时进行的初始化
	 * 不含附件
	 * @param map
	 */
	public void init(Map map) {
		this.setNno((Integer)map.get("nno"));
		this.setPno((Integer)map.get("pno"));
		this.setNtitle((String)map.get("ntitle"));
		this.setNcont((String)map.get("ncont"));
		this.setPtime((String)map.get("ptime"));
		this.setLtime((String)map.get("ltime"));
		this.setPubtype((String)map.get("pubtype"));
		this.setPubno((String)map.get("pubno"));
		this.setRootid((Integer)map.get("rootid"));
		this.setPid((Integer)map.get("pid"));
		this.setIsleaf((String)map.get("isleaf"));
		this.setPubname(new UserLogin().getName(this.getPubtype(), this.getPubno()));
		this.setAttach((String)map.get("isappend"));
		this.setReplyList(new SelNote().getReplyList(this.getNno()));
	}
	
	/**
	 * 查看主题帖详细时进行的初始化
	 * 含附件
	 * @param map
	 */
	public void initAttach(Map map) {
		if(this.getAttach().equals("1")) {
			this.setAttachList(new SelAttach().getNAttachName(this.getNno()));
		}
		this.setPubinfo(new UserLogin().getUserInfo(this.getPubtype(), this.getPubno()));
	}
	
	public int getRootid() {
		return rootid;
	}

	public void setRootid(int rootid) {
		this.rootid = rootid;
	}

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	
	
	public String getIsleaf() {
		return isleaf;
	}

	public void setIsleaf(String isleaf) {
		this.isleaf = isleaf;
	}
	
	public List<Map> getPubinfo() {
		return pubinfo;
	}

	public void setPubinfo(List<Map> pubinfo) {
		this.pubinfo = pubinfo;
	}
	
	public String getAttach() {
		return attach;
	}

	public void setAttach(String attach) {
		this.attach = attach;
	}

	public List<Map> getAttachList() {
		return attachList;
	}

	public void setAttachList(List<Map> attachList) {
		this.attachList = attachList;
	}
	
	public List<Map> getReplyList() {
		return replyList;
	}

	public void setReplyList(List<Map> replyList) {
		this.replyList = replyList;
	}

	public int getNno() {
		return nno;
	}

	public void setNno(int nno) {
		this.nno = nno;
	}

	public int getPno() {
		return pno;
	}

	public void setPno(int pno) {
		this.pno = pno;
	}

	public String getNtitle() {
		return ntitle;
	}

	public void setNtitle(String ntitle) {
		this.ntitle = ntitle;
	}

	public String getNcont() {
		return ncont;
	}

	public void setNcont(String ncont) {
		this.ncont = ncont;
	}

	public String getPtime() {
		return ptime;
	}

	public void setPtime(String ptime) {
		this.ptime = ptime;
	}

	public String getLtime() {
		return ltime;
	}

	public void setLtime(String ltime) {
		this.ltime = ltime;
	}

	public String getPubtype() {
		return pubtype;
	}

	public void setPubtype(String pubtype) {
		this.pubtype = pubtype;
	}

	public String getPubno() {
		return pubno;
	}

	public void setPubno(String pubno) {
		this.pubno = pubno;
	}

	public String getPubname() {
		return pubname;
	}

	public void setPubname(String pubname) {
		this.pubname = pubname;
	}

}
